package com.compomics.prioritizer.general;

/**
 * Created by IntelliJ IDEA.
 * User: Niklaas Colaert
 * Date: 7-nov-2008
 * Time: 13:31:40
 * To change this template use File | Settings | File Templates.
 */
public class TransformMascotTaxonomyFile {



    public TransformMascotTaxonomyFile(){

        //replace all * in the mod_file by !!!!!!!!!!\\n
        String  tax_file="Title:All entries\n" +
                "Include: 1\n" +
                "Exclude: 0\n" +
                "!!!!!!!!!!\n" +
                "Title:. . Archaea (Archaeobacteria)\n" +
                "Include: 2157\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . Eukaryota (eucaryotes)\n" +
                "Include: 2759\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Alveolata (alveolates)\n" +
                "Include: 33630\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Plasmodium falciparum (malaria parasite)\n" +
                "Include: 5833\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Other Alveolata\n" +
                "Include: 33630\n" +
                "Exclude: 5833\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Metazoa (Animals)\n" +
                "Include: 33208\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Caenorhabditis elegans\n" +
                "Include: 6239\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Drosophila (fruit flies)\n" +
                "Include: 7215\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Chordata (vertebrates and relatives)\n" +
                "Include: 7711\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . bony vertebrates\n" +
                "Include: 117571\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . lobe-finned fish and tetrapod clade\n" +
                "Include: 8287\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . Mammalia (mammals)\n" +
                "Include: 40674\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . . . Primates\n" +
                "Include: 9443\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . . . . . Homo sapiens (human)\n" +
                "Include: 9606\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . . . . . Other primates\n" +
                "Include: 9443\n" +
                "Exclude: 9606\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . . . Rodentia (Rodents)\n" +
                "Include: 9989\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . . . . . Mus.\n" +
                "Include: 10088\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . . . . . . . Mus musculus (house mouse)\n" +
                "Include: 10090\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . . . . . Rattus\n" +
                "Include: 10114\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . . . . . Other rodentia\n" +
                "Include: 9989\n" +
                "Exclude: 10088, 10114\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . . . Other mammalia\n" +
                "Include: 40674\n" +
                "Exclude: 9443, 9989\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . Xenopus laevis (African clawed frog)\n" +
                "Include: 8355\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . Other lobe-finned fish and tetrapod clade\n" +
                "Include: 8287\n" +
                "Exclude: 40674, 8355\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . Actinopterygii (ray-finned fishes)\n" +
                "Include: 7898\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . Takifugu rubripes (Japanese Pufferfish)\n" +
                "Include: 31033\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . Danio rerio (zebra fish)\n" +
                "Include: 7955\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . . . . . Other Actinopterygii\n" +
                "Include: 7898\n" +
                "Exclude: 31033, 7955, \n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . . . Other Chordata\n" +
                "Include: 7711\n" +
                "Exclude: 117571\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Other Metazoa\n" +
                "Include: 33208\n" +
                "Exclude: 7711, 6239, 7215\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Dictyostelium discoideum\n" +
                "Include: 44689 \n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Fungi\n" +
                "Include: 4751\n" +
                "Exclude: \n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Saccharomyces Cerevisiae (baker's yeast)\n" +
                "Include: 4932\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Schizosaccharomyces pombe (fission yeast)\n" +
                "Include: 4896\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Pneumocystis carinii\n" +
                "Include: 4754\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Other Fungi\n" +
                "Include: 4751\n" +
                "Exclude: 4932, 4896, 4754\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Viridiplantae (Green Plants)\n" +
                "Include: 33090\n" +
                "Exclude: \n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Arabidopsis thaliana (thale cress)\n" +
                "Include: 3702\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Oryza sativa (rice)\n" +
                "Include: 4530\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Other green plants\n" +
                "Include: 33090\n" +
                "Exclude: 3702, 4530\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Other Eukaryota\n" +
                "Include: 2759\n" +
                "Exclude: 33630, 33208, 44689, 4751, 33090\n" +
                "!!!!!!!!!!\n" +
                "Title:. . Bacteria (Eubacteria)\n" +
                "Include: 2\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Actinobacteria (class)\n" +
                "Include: 1760\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Mycobacterium tuberculosis complex\n" +
                "Include: 77643\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Other Actinobacteria (class)\n" +
                "Include: 1760\n" +
                "Exclude: 77643\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Firmicutes (gram-positive bacteria)\n" +
                "Include: 1239\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Bacillus subtilis\n" +
                "Include: 1423\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Mycoplasma\n" +
                "Include: 2093\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Streptococcus Pneumoniae\n" +
                "Include: 1313\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Streptomyces coelicolor\n" +
                "Include: 1902\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Other Firmicutes\n" +
                "Include: 1239\n" +
                "Exclude: 1423, 2093, 1313, 1902\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Proteobacteria (purple bacteria)\n" +
                "Include: 1224\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Agrobacterium tumefaciens\n" +
                "Include: 358\n" +
                "Exclude: \n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Campylobacter jejuni\n" +
                "Include: 197\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Escherichia coli\n" +
                "Include: 562\n" +
                "Exclude: \n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Neisseria meningitidis\n" +
                "Include: 487\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Salmonella\n" +
                "Include: 590\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . . . Other Proteobacteria\n" +
                "Include: 1224\n" +
                "Exclude: 358, 197, 562, 487, 590\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Other Bacteria\n" +
                "Include: 2\n" +
                "Exclude: 1760, 1239, 1224\n" +
                "!!!!!!!!!!\n" +
                "Title:. . Viruses\n" +
                "Include: 10239\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Hepatitis C virus\n" +
                "Include: 11103\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . . . Other viruses\n" +
                "Include: 10239\n" +
                "Exclude: 11103\n" +
                "!!!!!!!!!!\n" +
                "Title:. . Other (includes plasmids and artificial sequences)\n" +
                "Include: 28384, 12884\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . unclassified\n" +
                "Include: 12908\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n" +
                "Title:. . Species information unavailable\n" +
                "Include: -1\n" +
                "Exclude:\n" +
                "!!!!!!!!!!\n";
        String[] taxonomys = tax_file.split("!!!!!!!!!!\n");

        String result = "insert into `taxonomy`(name, accession, username, creationdate, modificationdate) values ";
        for(int i = 0; i<taxonomys.length; i++){
            String[] tax = taxonomys[i].split("\n");
            String title = tax[0].substring(6);

            String accession = tax[1].substring(9);
            result = result + " ('"+title+"',"+accession +",user(), now(),now()),\n";
        }
        result = result.substring(0, result.lastIndexOf(","));
        System.out.println(result);

    }

    public static void main(String[] args){
        TransformMascotTaxonomyFile trans = new TransformMascotTaxonomyFile();
    }
}





